// 电器类型接口
interface Appliance {
    void manufacture();
}

// 具体电器类型
class TV implements Appliance {
    @Override
    public void manufacture() {
        System.out.println("制造电视机");
    }
}

class AC implements Appliance {
    @Override
    public void manufacture() {
        System.out.println("制造空调");
    }
}

class Refrigerator implements Appliance {
    @Override
    public void manufacture() {
        System.out.println("制造冰箱");
    }
}

// 家电品牌接口
interface Brand {
    void produce(Appliance appliance);
}

// 具体家电品牌
class HaierBrand implements Brand {
    @Override
    public void produce(Appliance appliance) {
        System.out.print("海尔 ");
        appliance.manufacture();
    }
}

class TCLBrand implements Brand {
    @Override
    public void produce(Appliance appliance) {
        System.out.print("TCL ");
        appliance.manufacture();
    }
}

class HeisenBrand implements Brand {
    @Override
    public void produce(Appliance appliance) {
        System.out.print("海信 ");
        appliance.manufacture();
    }
}

// 客户端测试
public class Main {
    public static void main(String[] args) {
        Appliance tv = new TV();
        Appliance ac = new AC();
        Appliance refrigerator = new Refrigerator();

        Brand haier = new HaierBrand();
        Brand tcl = new TCLBrand();
        Brand heisen = new HeisenBrand();

        haier.produce(tv);          // 海尔制造电视机
        tcl.produce(ac);            // TCL制造空调
        heisen.produce(refrigerator);  // 海信制造冰箱
    }
}
